import os

def get_version_code():
    if os.path.exists('../Config/VersionCode.ini'):
        print("Version code is exist, openning..")
        with open('../Config/VersionCode.ini', 'r') as f:
            return f.read()
    else:
        print("Version code is not exist, creating...")
        with open('../Config/VersionCode.ini', 'w') as f:
            f.write("0")
            return f.read().strip()
    
def write_version_code(version_code):
    with open('../Config/VersionCode.ini', 'w') as f:
        f.write(version_code)

version_code = get_version_code()
new_version_code = str(int(version_code) + 1)

write_version_code(new_version_code)